package demo4;

public class Test {
    public static void fly(Iflying iflying) {
        iflying.fly();
    }
    public static void eating(Animal animal){
        animal.eat();
    }
    public static void swim(Iswimming iswimming){
        iswimming.swim();
    }
    public static void run(Irunning irunning){
        irunning.run();
    }
    public static void main(String[] args) {
//        Dog dog=new Dog("qq",2);
//        Duck duck=new Duck("ww",3);
//        Irunning irunning=new Robot();
//        irunning.run();
//        Iswimming iswimming=new Robot();
//        iswimming.swim();
//        dog.eat();
//        dog.swim();
//        dog.run();
//        duck.eat();
//        duck.swim();
//        duck.fly();
        fly(new Duck("ww",3));
        swim(new Dog("qq",2));
        eating(new Dog("qq",2));
        swim(new Robot());
    }
}
